#version 460
#extension GL_GOOGLE_include_directive : enable

#include "../../../../core/shader_color.h"
#include "../../../../core/shader_widget_color.h"
#include "../../../../core/shader_widget_panel.h"
#include "../../../../core/shader_tranform.h"

layout(location = 0) in vec2 inPos;
layout(location = 1) in vec2 inWeights;
layout(location = 2) in vec2 inNormal;


layout(location = 0) out vec4 vColor;
out gl_PerVertex {
	vec4	gl_Position;
};


//vec2 pos[4] = {vec2(10.0, 10.0), vec2(100.0, 10.0), vec2(10.0, 100.0), vec2(100.0, 100.0)};

void main(void){
	mat3x2 mat = m_LP_SD[gl_InstanceIndex];

	vec4 v = vec4(inPos, 0.0, 1.0);
	v.xy += mat[0];
	v.xy *= m_Scale;
	v.xy += m_Loc;
	
	v.xy = round(v.xy);
	gl_Position = mat_ProjecView * v;
	vColor = f_glsl_buildColor(InstanceColor[gl_InstanceIndex]);
	vColor = vec4(1);
}



